<template lang="html">
  <div class="">
    <div class="mjd">
            <div class="mjd_css">
                <ul>
                    <li class="clear" id="li_destination"  @click="toCounry()">
                        <div class="li_cs_le">
                            <span class="li_span">目的地</span>

                            <p class="li_p" :class="{'stlc3':flag3}" id="txtDestination" d-code="" style="color:#cccccc;">{{mudidata}}</p>
                        </div>
                        <a class="xian_right"></a>
                    </li>
                    <li d-id="dialog_date" @click="riqi()">
                                                <div id="txtDate"  class="gjz" :class="{'stlc':flag}" d-text="请选择您的出发月份" d-codes="" placeholder="请选择您的出发月份" style="overflow:hidden;">{{yufen}}</div>
                        <span class="tu_b"></span>
                    <span class="guanbi" d-tag="0"><img src="http://www.caissayl.com/static/images/h5/xq_10.jpg"></span>
                    </li>
                    <li d-id="dialog_city" @click="city()">
                                                <div id="txtCity" class="gjz" :class="{'stlc1':flag1}" d-text="请选择您的出发地" d-codes="" placeholder="请选择您的出发地" style="overflow:hidden;">{{dizhi}}</div>
                        <span class="tu_b jinqian"></span>
                    <span class="guanbi"  d-tag="0"><img src="http://www.caissayl.com/static/images/h5/xq_10.jpg"></span>
                    </li>
                    <li class="li_end" d-id="dialog_cruise" @click="lun()">
                                                <div id="txtCruise" class="gjz" :class="{'stlc2':flag2}" d-text="邮轮公司/船名称" d-company-codes="" d-ship-codes="" placeholder="邮轮公司/船名称" style="overflow:hidden;">{{companys}}</div>
                        <span class="tu_b chufa"></span>
                    <span class="guanbi" d-tag="0"><img src="http://www.caissayl.com/static/images/h5/xq_10.jpg"></span>
                    </li>
                </ul>
            </div>
        </div>
        <div @click="toTour()" class="chaxun"><img src="http://www.caissayl.com/static/images/h5/0_11.png"></div>
        <riqi v-show="riqiflag"></riqi>
        <city v-show="cityflag"></city>
        <youlun v-show="lunflag"></youlun>
      </div>
</template>

<script>
import riqi from './riqi1'
import city from './diacity'
import youlun from './youlun'
import bus from '../../js/bus'
export default {
  data(){
    return{
      riqiflag:false,
      cityflag:false,
      lunflag:false,
      flag:false,
      flag1:false,
      flag2:false,
      flag3:false,
      yufen:'请选择您的出发月份',
      dizhi:'请选择您的出发地',
      companys:'邮轮公司/船名称',
      mudidata:'请选择您的目的地'
    }
  },
  methods:{
    riqi(){
      this.riqiflag = true
    },
    city(){
      this.cityflag = true
    },
    lun(){
      this.lunflag = true
    },
    toCounry(){
      bus.$emit('cityflag')
    },
    toTour(){
      this.$router.push({
        path:'/tour1'
      })
    }
  },
  created(){
    bus.$on('riqizhi',data=>{
      this.riqiflag = false
      this.yufen = data
      this.flag = true
      console.log(data);
    })
    bus.$on('cityzhi',data=>{
      this.cityflag = false
      this.dizhi = data
      this.flag1 = true
      console.log(data);
    })
    bus.$on('lunzhi',data=>{
      this.lunflag = false
      this.companys = data
      this.flag2 = true
      console.log(data);
    })
    bus.$on('cityname',data=>{
      this.mudidata = data
      this.flag3 = true
      console.log(data + 'lalala');
      bus.$emit('citynameda',data)
    })
  },
  watch:{
    '$routes'(newValue,oldValue){
      console.log('吱吱吱');
      console.log(newValue.query.dat);
      this.mudidata = newValue.query.dat
      this.flag3 = true
    }
  },
  components:{
    riqi,
    city,
    youlun
  }
}
</script>

<style lang="css" scoped>
.stlc{
  color: black !important;
}
.stlc1{
  color: black !important;
}
.stlc2{
  color: black !important;
}
.stlc3{
  color: black !important;
}
.mjd {
    margin: 0px 15px;
    background-color: #FFF;
    border: 1px solid #ececec;
    -webkit-box-shadow: 0px 1px 1px #ececec;
    -moz-box-shadow: 0px 1px 1px #ececec;
    box-shadow: 0px 1px 1px #ececec;
    border-top: 0px;
    border-radius: 5px 5px 0px 0px;
}
.mjd_css {
    width: 100%;
    margin-top: 15px;
    text-align: left;
}
.mjd_css ul {
    width: 100%;
}
.mjd_css ul li {
    padding: 10px 15px;
    position: relative;
    display: block;
    border-bottom: 1px solid #ececec;
}
.li_cs_le {
    width: 65%;
    float: left;
}
.li_span {
    padding-top: 2px;
    width: 100%;
    display: block;
    font-size: 12px;
    color: #999999;
}
.li_p {
    width: 100%;
    padding-top: 5px;
    display: block;
    font-size: 16px;
    color: #333333;
}
.xian_right {
    width: 18px;
    height: 100%;
    position: absolute;
    right: 5px;
    top: -2px;
    background: url(../../../static/images/xq_10.jpg) no-repeat center center;
}
.clear::after {
    clear: both;
    content: "";
    display: block;
    height: 0;
    visibility: hidden;
}
.mjd_css ul li {
    padding: 10px 15px;
    position: relative;
    display: block;
    border-bottom: 1px solid #ececec;
}
.gjz, .gjz_xz {
    width: 70%;
    padding-left: 30px;
    height: 24px;
    line-height: 24px;
    font-size: 14px;
    color: #cccccc;
}
.tu_b, .jinqian, .chufa {
    width: 22px;
    height: 20px;
    background: url(../../../static/images/y_03.jpg) no-repeat center center;
    background-size: 20px 20px;
    position: absolute;
    z-index: 30;
    left: 10px;
    top: 13px;
}
.guanbi {
    width: 20px;
    height: 20px;
    text-align: right;
    display: block;
    position: absolute;
    right: 10px;
    z-index: 40;
    top: 11px;
    text-align: right;
}
.jinqian {
    background: url(../../../static/images/y_07.jpg) no-repeat center center;
    background-size: 22px 20px;
}
.chufa {
    background: url(../../../static/images/0_08.jpg) no-repeat center center;
    background-size: 22px 20px;
}
.chaxun {
    margin: 0px 15px 15px;
    display: block;
    border-radius: 5px;
}
.chaxun img {
    width: 100%;
}
</style>
